﻿#ifndef JSON_EXPLAIN_H
#define JSON_EXPLAIN_H

#include <QObject>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QMap>
#include "json_allcommand.h"
#include "type_valuekey.h"

typedef QMap<QString, type_valueKey> shareMap;

typedef QMap<int, bool> LISTMAP;
typedef QList<LISTMAP> MAPLIST;
class Json_explain : public QObject, public Json_AllCommand
{
    Q_OBJECT
public:
    explicit Json_explain(QObject *parent = 0);

    bool explain_MontionDataString(QString dataString);
    bool explain_SystemSettingDataString(QString dataString);
    bool explain_IODiagnose(QString dataString);
    bool explain_manualDiagnose(QString dataString);
    bool explain_runningstatus(QString dataString);
    bool explain_readyStatus(QString dataString);
    QVector<bool> getAxisSetting(int num);
    QVector<QVector<bool> > getAllLimit(int num);

    bool explainReply(QString resultString);

    QStringList getJsonObjectNameString(QString dataString);

    shareMap dataMap;
    QMap<QString,QList<QMap<int, bool> > > DIDOdiagnoseMap;
    QMap<QString,QList<QMap<int, double> > > AIAOdiagnoseMap;
private:
    bool order_runningstatusExplain(QString commandString,QString dataString);
    bool explainCheckLineNumCommand(QString resultString);
    bool explainCurrentSpeedCommand(QString resultString);
    bool explainOutPutCommand(QString resultString);
    bool explainRunTimeCommand(QString resultString);
    bool explainRunStateCommand(QString resultString);
    bool order_manualDiagnoseExplain(QString commandString,QString dataString);
    bool explainLimitAlarmCommand(QString resultString);
    bool explainCoordinateCommand(QString resultString, int axis);
    bool order_MontionSettingExplain(QString commandString,QString dataString);
    bool order_SystemSettingExplain(QString commandString,QString dataString);
    bool explainDPRCommand(QString resultString, int axis);
    bool explainPPRCommand(QString resultString, int axis);
    bool explainBackZeroDirCommand(QString resultString,int axis);
    bool explainMaxSpeedCommand(QString resultString,int axis);
    bool explain_AccelerateCommand(QString resultString,int axis);
    bool explain_MotorDirCommand(QString resultString,int axis);
    bool explainAddLimitDisCommand(QString resultString,int axis);
    bool explainReduceLimitDisCommand(QString resultString,int axis);
    bool explainRotationAxisCommand(QString resultString);
    bool explainAxisStyleCommand(QString resultString);
    bool explainAxisEnableCommand(QString resultString);

    bool explainbackZeroSpeedCommand(QString resultString);
    bool explainManualSpeedCommand(QString resultString);
    bool explainBackZeroCommand(QString resultString);
    bool explainGlueFogCommand(QString resultString);
    bool explainFogTimeCommand(QString resultString);
    bool explainCirculateCommand(QString resultString);
    bool explainLimitDisCommand(QString resultString,int axis);
    bool explainIO_ReUseCommand(QString resultString,int axis);
    bool explainLimopCommand(QString resultString);
signals:

public slots:

};

#endif // JSON_EXPLAIN_H
